/*!
\file EdgeList.cpp
\brief Contains implementation of EdgeList.
\ingroup Graph
*/

#include"EdgeList.h"

EdgeList::EdgeList( bool isDirected ){
	m_isDirected = isDirected;
}

int EdgeList::operator[](int i)const{
	for( int j = 0; j < m_edges.size(); j++ ){
		if( m_isDirected ){
			if( m_edges[j].to().identifier() == i )
				return m_edges[j].identifier();
		}else{
			if( m_edges[j].from().identifier() == i || m_edges[j].to().identifier() == i )
				return m_edges[j].identifier();
		}
	}
	return -1;
}
